package org.shj.book2.chapter12;

import org.shj.book2.chapter12.active.ActiveObject;

public class DisplayClientThread extends Thread{

	private final ActiveObject activeObj;
	
	public DisplayClientThread(String name, ActiveObject activeObj){
		super(name);
		this.activeObj = activeObj;
	}
	
	public void run(){
		try{
			for(int i = 0 ; true; i++){
				String string = Thread.currentThread().getName() + " " + i;
				activeObj.displayString(string);
				Thread.sleep(200);
			}
		}catch(InterruptedException e){
			
		}
	}
}
